/**
 * 修改密码 add by gsh
 */

// 修改密码
function changePassword(id) {
	var index = msgWnd.open({
		title : "修改密码",
		skin : 'layui-layer-lan',
		type : 2,
		shade : 0.5,
		area : [ "430px", "350px" ],
		maxmin : true,
		content : '/system/admin/password/change',
		zIndex : layer.zIndex
	});
}

//重设密码
function resetPsw(_id) {
	var index = msgWnd.confirm("确认重置码？", {
		title : "重置密码",
		skin : 'layui-layer-lan',
		btn : [ "确定", "取消" ],
		icon : 1
	}, function() {
		$.ajax({
			type : "POST",
			url : "/system/admin/password/reset/" + _id,
			dataType : "json",
			success : function(msg) {
				if (msg.data.status == 1) {
					msgTools.alert("重设密码", "重设成功,新密码为 888888 ,请尽快修改。", 1000);
					if(typeof(reloadPg)!="undefined")
						reloadPg();
					else
						window.location.href = window.location.href;
				} else {
					msgTools.alert("重设密码", "重设失败。", 2000);
				}
			}
		});
		msgWnd.close(index);
	});
}